<?php
/**
 * Created by 项目.
 * User: xuguopeng
 * Date: 6/2/21
 * Time: 1:29 PM
 */

namespace app\api\model;


class User extends BaseModel
{
    public static function getOpenId($openid)
    {
        $user = self::where('openid','=',$openid)
            ->find();
        return $user;
    }

    // 店面信息
    public function store()
    {
        return $this->belongsTo('Store','store_id','id');
    }

    // 用户分享
    public function invite()
    {
        return $this->belongsTo('UserInvitation','id','invitee');
    }
}